#include "GenerateNewSurface.h"

GenerateNewSurface::GenerateNewSurface(QWidget *parent): QDialog(parent)
{
    setupUi(this);

    connect(this->surface_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(SurfaceTypeSelectionChanged(int)));

    param_0_lbl->setText("Radius");
    param_1_lbl->setText("Bottom");
    param_2_lbl->setText("Top");
    param_0_dsb->setValue(1.0);
    param_1_dsb->setValue(-1.0);
    param_2_dsb->setValue(1.0);
    param_0_lbl->setEnabled(true);
    param_1_lbl->setEnabled(true);
    param_2_lbl->setEnabled(true);
    param_0_dsb->setEnabled(true);
    param_1_dsb->setEnabled(true);
    param_2_dsb->setEnabled(true);
}

void GenerateNewSurface::SurfaceTypeSelectionChanged(int index)
{
    switch (index)
    {
    case 0:
        param_0_lbl->setText("Radius");
        param_1_lbl->setText("Bottom");
        param_2_lbl->setText("Top");
        param_0_dsb->setValue(1.0);
        param_1_dsb->setValue(-1.0);
        param_2_dsb->setValue(1.0);
        param_0_lbl->setEnabled(true);
        param_1_lbl->setEnabled(true);
        param_2_lbl->setEnabled(true);
        param_0_dsb->setEnabled(true);
        param_1_dsb->setEnabled(true);
        param_2_dsb->setEnabled(true);
        break;
    case 1:
        param_0_lbl->setText("Smaller Radius");
        param_1_lbl->setText("Bigger Radius");
        param_2_lbl->setText("");
        param_0_dsb->setValue(1.0);
        param_1_dsb->setValue(1.1);
        param_2_dsb->setValue(0.0);
        param_0_lbl->setEnabled(true);
        param_1_lbl->setEnabled(true);
        param_2_lbl->setEnabled(false);
        param_0_dsb->setEnabled(true);
        param_1_dsb->setEnabled(true);
        param_2_dsb->setEnabled(false);
        break;
    case 2:
        param_0_lbl->setText("Radius");
        param_1_lbl->setText("");
        param_2_lbl->setText("");
        param_0_dsb->setValue(1.0);
        param_1_dsb->setValue(0.0);
        param_2_dsb->setValue(0.0);
        param_0_lbl->setEnabled(true);
        param_1_lbl->setEnabled(false);
        param_2_lbl->setEnabled(false);
        param_0_dsb->setEnabled(true);
        param_1_dsb->setEnabled(false);
        param_2_dsb->setEnabled(false);
        break;
    }
}
